import QtQuick

Rectangle {
  id: root
  width: popupText.implicitWidth + 8
  height: popupText.implicitHeight + 8
  radius: 5
  color: '#b6000000'

  property alias text: popupText.text
  property alias anim: detroyAnim

  Text {
    id: popupText
    anchors.centerIn: parent
    width: Math.min(implicitWidth, 340)
    horizontalAlignment: Text.AlignHCenter
    wrapMode: Text.WordWrap
    color: "white"
    font.pixelSize: 13
    style: Text.Outline
    styleColor: "black"
  }

  SequentialAnimation {
    id: detroyAnim
    PauseAnimation { duration: 1990 }
    PropertyAnimation {
      target: root
      property: "opacity"
      to: 0
      duration: 300
    }
  }
}